using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

 
public class Refactor 
{
    private Object objeto;
    private Type type;
    public Refactor(Object objeto1) {
        objeto = objeto1;
        type = objeto1.GetType( );
    }

    public string getValue(string atributo)
    {
        object obj = (type.GetProperty(atributo).GetValue(objeto, null));

        return HttpUtility.HtmlEncode(obj.ToString()); 
    }

    public string getValueJS(string atributo)
    {
        object obj = (type.GetProperty(atributo).GetValue(objeto, null));
        return Tarea.JSEncode(obj.ToString( ));
    }

}
